package top.toptimus.dto.recipe;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@NoArgsConstructor
@Data
@AllArgsConstructor
public class CraftFacadeDesignDTO {
    private String id;
    private String partId;  //  部位id
    private String partDesc;    //  部位描述
    private String facadeCode;  //  外观设计编码

    private Integer designId;    //  设计点主键
    private String facadeValue; //  设计点名称

    private String imageFilePath;   //  图片路径
    private List<CraftDesignItemDTO> craftDesignItemDTOList = new ArrayList<>();

    public CraftFacadeDesignDTO(
            String id,
            String partId,
            String partDesc,
            String facadeCode,
            Integer designId,
            String facadeValue,
            String imageFilePath
    ) {
        this.imageFilePath = imageFilePath;
        this.facadeValue = facadeValue;
        this.designId = designId;
        this.facadeCode = facadeCode;
        this.partDesc = partDesc;
        this.partId = partId;
        this.id = id;
    }

    /**
     * 重新构造
     *
     * @param craftFacadeDesignDTO craftFacadeDesignDTO
     * @return this
     */
    public CraftFacadeDesignDTO reBuild(CraftFacadeDesignDTO craftFacadeDesignDTO) {
        this.partId = craftFacadeDesignDTO.getPartId();
        this.partDesc = craftFacadeDesignDTO.getPartDesc();
        this.facadeCode = craftFacadeDesignDTO.getFacadeCode();
        this.designId = craftFacadeDesignDTO.getDesignId();
        this.facadeValue = craftFacadeDesignDTO.getFacadeValue();
        this.imageFilePath = craftFacadeDesignDTO.getImageFilePath();
        this.craftDesignItemDTOList = craftFacadeDesignDTO.craftDesignItemDTOList;
        return this;
    }
}
